package com.miao.shop.service;

import com.miao.shop.entity.ShopCar;
import com.miao.shop.entity.vo.OrderVO;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author MiaoWenqing
 * @description: 购物车服务层
 * @date 2021/2/16 22:14
 */
@Service
public interface ShopCarService {


    /**
     * 添加商品
     * @param pId 商品id
     * @param sId  店铺id
     * @param uId  用户id
     * @return boolean
     */
    boolean addProduct(String pId,String sId,String uId,int num);


    /**
     * 删除商品
     * @param pId 商品id
     * @param sId  店铺id
     * @param uId  用户id
     * @return boolean
     */
    boolean delProduct(String pId,String sId,String uId);




    /**
     * 修改商品数量
     * @param pId 商品id
     * @param sId  店铺id
     * @param uId  用户id
     * @param num 数量
     * @return boolean
     */
    boolean editNum(String pId,String sId,String uId,int num);


    /**
     * 修改选中状态
     * @param pId 商品id
     * @param sId  店铺id
     * @param uId  用户id
     * @return boolean
     */
    boolean editSelect(String pId,String sId,String uId);


    /**
     * 根据用户id 获取购物车
     * @param uid 用户id
     * @return list
     */
    List<ShopCar> getCar(String uid);
}
